<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<title>
			Document
		</title>
		<script type='text/javascript' src='http://localhost/hdphp-master/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/hdphp-master/hdphp/hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<link href='http://localhost/hdphp-master/hdphp/hdjs/css/hdvalidate.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdphp-master/hdphp/hdjs/js/hdjs.js'></script>
<script src='http://localhost/hdphp-master/hdphp/hdjs/js/hdvalidate.js'></script>
<script src='http://localhost/hdphp-master/hdphp/hdjs/js/slide.js'></script>
<script src='http://localhost/hdphp-master/hdphp/hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
HOST = '<?php echo $GLOBALS['user']['HOST'];?>';
ROOT = '<?php echo $GLOBALS['user']['ROOT'];?>';
WEB = '<?php echo $GLOBALS['user']['WEB'];?>';
URL = '<?php echo $GLOBALS['user']['URL'];?>';
APP = '<?php echo $GLOBALS['user']['APP'];?>';
COMMON = '<?php echo $GLOBALS['user']['COMMON'];?>';
HDPHP = '<?php echo $GLOBALS['user']['HDPHP'];?>';
HDPHPDATA = '<?php echo $GLOBALS['user']['HDPHPDATA'];?>';
HDPHPEXTEND = '<?php echo $GLOBALS['user']['HDPHPEXTEND'];?>';
MODULE = '<?php echo $GLOBALS['user']['MODULE'];?>';
CONTROLLER = '<?php echo $GLOBALS['user']['CONTROLLER'];?>';
ACTION = '<?php echo $GLOBALS['user']['ACTION'];?>';
STATIC = '<?php echo $GLOBALS['user']['STATIC'];?>';
HDPHPTPL = '<?php echo $GLOBALS['user']['HDPHPTPL'];?>';
VIEW = '<?php echo $GLOBALS['user']['VIEW'];?>';
PUBLIC = '<?php echo $GLOBALS['user']['PUBLIC'];?>';
CONTROLLERVIEW = '<?php echo $GLOBALS['user']['CONTROLLERVIEW'];?>';
HISTORY = '<?php echo $GLOBALS['user']['HISTORY'];?>';
</script>
		<script type="text/javascript" src="http://localhost/llq/ESHOP/Admin/View/GoodsAttr/js/js.js"></script>
		<link type="text/css" rel="stylesheet" href="http://localhost/llq/ESHOP/Admin/View/GoodsAttr/css/css.css"/>
	</head>
	<body>
		<div class="wrap">
			<div class="menu_list">
				<ul>
					<li>
						<a href="<?php echo U('index',array('gtid'=>$gtid));?>"  class="action">
							属性列表
						</a>
					</li>
				</ul>
			</div>
			<div class="title-header" >
				添加商品类型
			</div>
			<form method="post" class="hd-form">
				<input type="hidden" name="aid" value="<?php echo $attr['aid'];?>" />
				<input type="hidden" name='gtid' value="<?php echo $gtid;?>" />
				<table class="table1">
					<tr>
						<th class="w100">
							属性名称
						</th>
						<td>
							<input type="text" name='attr_name' class="w200" value="<?php echo $attr['attr_name'];?>"/>
						</td>
					</tr>
					<tr>
						<th class="w100">
							规格属性
						</th>
						<td>
							<label>
								<input type="radio" name='spec' value='1' <?php if($attr['spec'] == 1){?>checked=""<?php }?>/>
								是
							</label>
							<label>
								<input type="radio" name='spec' value='0' <?php if($attr['spec'] == 0){?>checked=""<?php }?>/>
								否
							</label>
						</td>
					</tr>
					<tr>
						<th class="w100">
							显示方式
						</th>
						<td>
							<label>
								<input type="radio" name='show_type' value='text' <?php if($attr['show_type'] == "text"){?>checked=""<?php }?> onclick='alterAttrType()'/>
								文本框
							</label>
							<label>
								<input type="radio" name='show_type' value='radio' <?php if($attr['show_type'] == "radio"){?>checked=""<?php }?> onclick='alterAttrType()'/>
								单选
							</label>
							<label>
								<input type="radio" name='show_type' value='checkbox' <?php if($attr['show_type'] == "checkbox"){?>checked=""<?php }?> onclick='alterAttrType()'/>
								多选
							</label>
							<label>
								<input type="radio" name='show_type' value='select' <?php if($attr['show_type'] == "select"){?>checked=""<?php }?> onclick='alterAttrType()'/>
								下拉列表
							</label>
						</td>
					</tr>
					<tr>
						<th>
							属性值
						</th>
						<td>
							<table class="table1" id='attrList'>
								<?php $hd["list"]["a"]["total"]=0;if(isset($attr_value) && !empty($attr_value)):$_id_a=0;$_index_a=0;$lasta=min(1000,count($attr_value));
$hd["list"]["a"]["first"]=true;
$hd["list"]["a"]["last"]=false;
$_total_a=ceil($lasta/1);$hd["list"]["a"]["total"]=$_total_a;
$_data_a = array_slice($attr_value,0,$lasta);
if(count($_data_a)==0):echo "";
else:
foreach($_data_a as $key=>$a):
if(($_id_a)%1==0):$_id_a++;else:$_id_a++;continue;endif;
$hd["list"]["a"]["index"]=++$_index_a;
if($_index_a>=$_total_a):$hd["list"]["a"]["last"]=true;endif;?>

								<tr>
									<td>
										<input type="text" name='av_value[]' class="w200" value='<?php echo $a['av_value'];?>'/>
										<input type="hidden" name='avid[]' value='<?php echo $a['avid'];?>'/>
										<?php if($hd['list']['a']['index'] > 1){?>
											<button class="hd-cancel" type="button" onclick="delAttrTr(this)">删除</button>
										<?php }?>
										<button class="hd-cancel" type='button' id='addAttr' onclick="addAttrTr(this)">
											添加
										</button>
									</td>
								</tr>
								<?php $hd["list"]["a"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							</table>
						</td>
					</tr>
				</table>
				<div class="position-bottom">
					<input type="submit" class="hd-success" />
				</div>
			</form>
		</div>
		<script>$('form').validate({
	gt_name: {
		rule: {
			required: true
		},
		error: {
			required: '不能为空'
		}
	}
})</script>
	</body>
</html>
